package com.ruoyi.douyin.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.douyin.service.VideoService;
import com.ruoyi.system.domain.vo.DouyinVideoListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/video")
public class VideoController {
    @Autowired
    private VideoService videoService;

    /**
     * 视频播放的列表
     *
     * @param douyinVideoListVoList 页码&用户Id
     */
    @PostMapping("/list")
    public AjaxResult VideoList(@RequestBody List<DouyinVideoListVo> douyinVideoListVoList) {
        return videoService.videoList(douyinVideoListVoList);
    }

    /**
     * 视频的详情
     */
    @PostMapping("/detail/{openId}")
    public AjaxResult VideoDetail(@RequestBody List<String> itemIds,
                                  @PathVariable String openId) {
        return videoService.videoDetail(itemIds, openId);
    }
}
